pp108 : Transfer Task

Transfer Task

This method can be used to transfer a task to a different target from what is currently present.

Resource URI
/v1/tasks/transferTask
Request Type

HTTP POST

HTTP Header Parameters

Parameter

Description

Accepted Input Values

SAMLart

The SAML artifact received after authentication. For more information on how to authenticate, see Login.
otdsticket The OTDSTicket received after authentication from OTDS. The OTDSTicket must be provided as a header parameter. For more information on how to authenticate, see Login.

Note : You must provide either SAMLart or otdsticket header parameter. If you provide both the header parameters, it will internally work based on SAMLart.

Note: The supported output formats are:

  • JSON
  • XML
Request Parameters

Parameter

Description

Accepted Input Values

taskId Unique identifier of the task For example:
taskId: 002481F0-8E9F-11E3-FB98-BD04D5FA7BB1
memo

 

Contents in the memo. This field is mandatory.

dueDate

Date by which the task must be completed

ANY_DATE_VALUE

For example: 2014-05-23T04:25:13.0

type

Indicates the target that needs to be considered.

  • You can specify the target type by specifying one of the following values for the attribute type:
    • user - Provides the DN of the user to whom the task needs to be transferred. Multiple user DNs can be provided, with each in a separate Assignee element.
    • role - Provides the DN of the role to which the task needs to be transferred. Multiple role DNs can be provided, with each in a separate Assignee element.
    • worklist - Provides the ID of the work list to which the task needs to be transferred. Only one Assignee element is allowed.
    • team - Provides the ID of the team to which the task needs to be transferred. Only one Assignee element is allowed.
Assignee

Contains the DN of the assignee, who claims the task or to whom the task is assigned by the manager.parameter.

The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

For example: 

cn=finance,cn=organizational roles,o=system,cn=cordys,cn=build22,o=vanenburg.com

Note: All the above parameters must be send inside the TransferTask object in the payload section of the HTTP POST call.  

Sample HTTP Payload

POST accepts the payload content only in the XML format as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TransferTask xmlns="http://schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http://schemas.cordys.com/General/1.0/">
	<TaskId>00505681-3301-11E3-FF8A-FA4669915FDC</TaskId>
	<Target type="user">
		<Assignee>cn=RestUser,cn=organizational users,o=system,cn=cordys,cn=srvinddvm7iw,o=vanenburg.com</Assignee>
	</Target>
	<Memo>Test Transfering Task with SMAL Alone</Memo>
	<DueDate/>
</TransferTask>
 
Note : we need to send "<Assignee>" tag, Not the <target> XML tag inside <Target> on Input xml. 
Sample Client Example

Add the HTTP Payload as follows:

public static void main(String[] args) throws JAXBException,ClientProtocolException, IOException {
 
 com.cordys.entity.bean.TransferTask taskTransferInput=new com.cordys.entity.bean.TransferTask();
taskTransferInput.setTaskId("02481F0-8E9F-11E3-FE11-F2FB4784D7E1");
 taskTransferInput.setTaskId("002481F0-8E9F-11E3-FE11-E2BFA5CBF7E1");
 taskTransferInput.setDueDate("");
 taskTransferInput.setMemo("Test Transfering Task with OTDS Alone");
 com.cordys.entity.bean.TransferTask.Target target= new com.cordys.entity.bean.TransferTask.Target();
 target.setAssignee("cn=Test_New_laxman,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com");
 target.setType("user");
 taskTransferInput.setTarget(target);
StringWriter writer = new StringWriter();
 JAXBContext jaxbContext = JAXBContext.newInstance(com.cordys.entity.bean.TransferTask.class);
 Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
 jaxbMarshaller.marshal(taskTransferInput, writer);
 
 DefaultHttpClient httpClient = new DefaultHttpClient();
 // Define a postRequest request
 HttpPost postRequest = new HttpPost(
 "http://localhost:8090/BPMService/v1/tasks/transferTask");
// Set the API media type in http content-type header
 //postRequest.addHeader("SAMLart","MDEUkKOCWs8vQY+gYqa28mHjKoN0V+gJI8/zKxA4BveCdAA/LA+COJau");
 postRequest.addHeader("otdsticket","ADBnQ7M0nXrdExS");
 postRequest.addHeader("content-type", "application/xml");
// Set the request post body
 StringEntity userEntity = new StringEntity(writer.getBuffer().toString());
 postRequest.setEntity(userEntity);
// Send the request; It will immediately return the response in
 // HttpResponse object if any
 HttpResponse response = httpClient.execute(postRequest);
...
}

Note: The com.cordys.entity.bean.TransferTask object structure has been attached below, which is expected as a parameter of the REST API:

public Response transferTask( com.cordys.entity.bean.TransferTask)

TransferTask.java class is packed on BPMServiceClient.jar.

Response Parameters

Parameter

Description

TaskId

Contains the unique identifier of the task

ParentTaskId

This ID is used to group all the tasks, which are assigned to the same role with the All linked users should execute task option enabled in the Activity Properties.

Targets

Type of target where the task is sent

ProcessInstanceId

Contains the unique identifier of the source, which created this task

State

Contains the current state of the task

ProcessName

Contains the name of the source, which created this task

Activity

Contains the subject of the task

Sender

Contains the DN of the sender of the task. The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

Assignee

Contains the DN of the assignee, who claims the task or to whom the task is assigned by the manager. The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

BusinessAttributes

Contains the business attributes XML of the task

CompletedByUser

Contains the DN of the user who completes the task

DelegatedToUser

Contains the DN of the user to whom the task is delegated

Priority

Contains the priority set on the task. It is set between 0 and 5.

  • 0 - Denotes lowest priority
  • 5 - Denotes highest priority

TaskData

Contains application data and custom data

ApplicationData

Contains the data, which the task has to perform in the XML format

StartDate

Contains the date on which the task must be started

StartedOn

Contains the date on which the task has started

DueDate isExpired

Contains the date on which the task is due. When isExpired is true, the due date is already past.

DeliveryDate

Contains the date on which the task is created

CompletionDate

Contains the date on which the task is completed

IsPriorityFixed

Contains the state of priority

Note: If 1, the priority cannot be changed.

ParentQueue

Contains the Work List ID of the parent work list. While transferring the tasks to a different work list, the work list from which the task is transferred, is referred as the parent queue.

UITaskId

Contains the unique identifier of the application

url

Contains the URL of the application or the user interface that needs to be opened

PossibleActions

Possible actions that the user can perform on this task
Sample Response
JSON Response : 
{
	Task: [1]0: {
		url: "ui.caf"TaskId: "002481F0-8E9F-11E3-FB98-BD04D5FA7BB1"ParentTaskId: "002481F0-8E9F-11E3-FB98-BD04D5FA7BB1"ProcessInstanceId: "002481F0-8E9F-11E3-FB98-BD04D5FA1BB1"State: "ASSIGNED"ProcessName: "bpmSample"Activity: "Notif Subject"Sender: {
			value: "cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "lgautam"phone1: ""phone2: ""email: ""
		}-BusinessAttributes: {
			
		}Assignee: {
			value: "cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "lgautam"phone1: ""phone2: ""email: ""
		}-CompletedByUser: {
			value: ""displayName: nullphone1: nullphone2: nullemail: null
		}-LoggerContext: "<Logger xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns="http: //schemas.cordys.com/General/1.0/"><DC name="process">bpmSample</DC><DC name="instance">002481F0-8E9F-11E3-FB98-BD04D5FA1BB1</DC></Logger>"DeliveryDate: "2014-05-16T06:47:12.0"StartDate: "2014-05-16T06:47:12.0"DueDate: {
			value: ""isExpired: false
		}-StartedOn: ""CompletionDate: ""IsPriorityFixed: falsePriority: "3"ParentQueue: "002481F0-8E9F-11E3-FB84-31AE2052D713"ActivityId: "o_2"Component: "BPM"Targets: {
			Target: [1]0: {
				value: "cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"type: "user"
			}--
		}-TaskData: {
			ApplicationData: {
				any: "<?xml version="1.0" encoding="UTF-16"?> <proc:forminputdata xmlns="http: //schemas.cordys.com/1.0/xforms/processapi" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/" xmlns:proc="http: //schemas.cordys.com/1.0/xforms/processapi"><proc:freeformcontrols><proc:input1 display_name="Input1"/></proc:freeformcontrols></proc:forminputdata>"
			}-CustomData: {
				any: null
			}-Annotation: {
				any: null
			}-
		}-PossibleActions: {
			COMPLETE: "<?xml version="1.0" encoding="UTF-16"?> <COMPLETE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"DELEGATE: "<?xml version="1.0" encoding="UTF-16"?> <DELEGATE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"FORWARD: "<?xml version="1.0" encoding="UTF-16"?> <FORWARD xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"START: "<?xml version="1.0" encoding="UTF-16"?> <START xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"SUSPEND: "<?xml version="1.0" encoding="UTF-16"?> <SUSPEND xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"SKIP: "<?xml version="1.0" encoding="UTF-16"?> <SKIP xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"EXECUTE: "<?xml version="1.0" encoding="UTF-16"?> <EXECUTE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"VIEW: "<?xml version="1.0" encoding="UTF-16"?> <VIEW xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"TRANSFER: "<?xml version="1.0" encoding="UTF-16"?> <TRANSFER xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"
		}-
	}--
}
	

 

 

Attachments: